package Matrix;

public class Triple implements Comparable<Triple>{
    private int row,column,value;

    public Triple() {
        this.row = -1;
        this.column = -1;
        this.value = -1;
    }

    public Triple(int row, int column, int value) {
        this.row = row;
        this.column = column;
        this.value = value;
    }

    public int getRow() {
        return row;
    }

    public void setRow(int row) {
        this.row = row;
    }

    public int getColumn() {
        return column;
    }

    public void setColumn(int column) {
        this.column = column;
    }

    public int getValue() {
        return value;
    }

    public void setValue(int value) {
        this.value = value;
    }

    @Override
    public int compareTo(Triple tri) {
        if (this.row> tri.row)return 1;
        else if (this.row < tri.row)return -1;
        else {
            if (this.column > tri.column) return 1;
            else if (this.column < tri.column)return -1;
            else {
                return Integer.compare(this.value, tri.value);
            }
        }
    }
}
